package com.dto.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dto.*;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author xufan
 */

@TableName(value = "company_employee")
@Data
public class EmployeeDto extends BaseDto {
    /**
     * 员工id
     */
    @NotNull(message = "员工id不能为空", groups = {QueryDetail.class, Update.class, Delete.class})
    @TableId(value = "id", type = IdType.AUTO)
    private String employeeId;
    /**
     * 员工姓名
     */
    @NotNull(message = "员工姓名不能为空", groups = {Save.class, Update.class})
    private String employeeName;
    /**
     * 员工手机号
     */
    @NotNull(message = "员工手机号不能为空", groups = {Save.class, Update.class})
    @Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号格式错误")
    private String phone;

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
